.. This file was automatically converted from MediaWiki syntax. If some markup is wrong, looks weird or doesn't make sense, feel free to fix it. Please remove this comment once this file was manually checked and no "strange ReST" artifacts remain. .. _pre-defined-vertex-formats: Pre-defined vertex formats ========================== Panda3D predefines a handful of standard :ref:`geomvertexformat` objects that might be useful to you. If you don't have any special format needs, feel free to use any of these standard formats, which have already been defined and registered, and are ready to use for rendering. Each of these formats includes one or more of the standard columns vertex, normal, color, and/or texcoord. For the formats that include a color column, there are two choices, since OpenGL and DirectX have competing internal formats for color (but you can use either form regardless of your current rendering API; Panda will automatically convert the format at render time if necessary). .. only:: python +---------------+---------------+---------------+---------------+---------------+---------------+ | **Standard | **vertex** | **normal** | **color**, | **color**, | **texcoord** | | format** | (X, Y, Z) | (X, Y, Z) | 4-component | packed RGBA | (U, V) | | | | | RGBA | (DirectX styl | | | | | | (OpenGL style | e) | | | | | | ) | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | | | | | mat.getV3() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | | | | | mat.getV3n3() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | | | ✓ | | mat.getV3t2() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | | | ✓ | | mat.getV3n3t2 | | | | | | | () | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | ✓ | | | | mat.getV3c4() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | ✓ | | | | mat.getV3n3c4 | | | | | | | () | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | ✓ | | ✓ | | mat.getV3c4t2 | | | | | | | () | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | ✓ | | ✓ | | mat.getV3n3c4 | | | | | | | t2() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | | ✓ | | | mat.getV3cp() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | | ✓ | | | mat.getV3n3cp | | | | | | | () | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | | ✓ | ✓ | | mat.getV3cpt2 | | | | | | | () | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | | ✓ | ✓ | | mat.getV3n3cp | | | | | | | t2() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ .. only:: cxx +---------------+---------------+---------------+---------------+---------------+---------------+ | **Standard | **vertex** | **normal** | **color**, | **color**, | **texcoord** | | format** | (X, Y, Z) | (X, Y, Z) | 4-component | packed RGBA | (U, V) | | | | | RGBA | (DirectX styl | | | | | | (OpenGL style | e) | | | | | | ) | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | | | | | mat::get\_v3( | | | | | | | ) | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | | | | | mat::get\_v3n | | | | | | | 3() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | | | ✓ | | mat::get\_v3t | | | | | | | 2() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | | | ✓ | | mat::get\_v3n | | | | | | | 3t2() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | ✓ | | | | mat::get\_v3c | | | | | | | 4() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | ✓ | | | | mat::get\_v3n | | | | | | | 3c4() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | ✓ | | ✓ | | mat::get\_v3c | | | | | | | 4t2() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | ✓ | | ✓ | | mat::get\_v3n | | | | | | | 3c4t2() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | | ✓ | | | mat::get\_v3c | | | | | | | p() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | | ✓ | | | mat::get\_v3n | | | | | | | 3cp() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | | | ✓ | ✓ | | mat::get\_v3c | | | | | | | pt2() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+ | GeomVertexFor | ✓ | ✓ | | ✓ | ✓ | | mat::get\_v3n | | | | | | | 3cpt2() | | | | | | +---------------+---------------+---------------+---------------+---------------+---------------+